#!/usr/bin/env python
#    dftmm_5
#    -----------
#    Molecule:         CH2O(DFT)/2 H2O(MM)
#    Wave Function:    B3LYP / STO-3G  
#    Test Purpose:     Test of DFT/MM first hyperpolarizability 

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()

#enedft
f.add(string = 'Final DFT energy',
      rel_tolerance = 1.0e-9)

#qm3convergence
f.add(from_string = 'QM/MM "QM3" calculation converged',
      num_lines = 6,
      rel_tolerance = 1.0e-5)

# Test of first hyperpolarizability 
f.add(string = 'B-freq =',
      abs_tolerance = 1.0e-5)

test.run(['dftmm_5.dal'], ['CH2O_STO-3G_2H2O_MM.mol'], f={'out': f}, args='-put POTENTIAL.INP')

sys.exit(test.return_code)


#
